Skip to content

Conversation

@mmagician
Copy link
Collaborator

  • UPDATE_GER note script that carries two storage words [GER_LOWER[4], GER_UPPER[4]]
  • update_ger procedure on the bridge
  • two storage slots to store the lower & upper parts of the GER in the bridge
  • refactored create_bridge* helper functions
    • create_bridge_account_builder now uses both BridgeIn & BridgeOut components in a single account
    • BridgeOut doesn't need the miden::agglayer::bridge storage slot it used to have
    • instead, BridgeIn gets two storage slots to store single values (upper & lower limbs of the GER)

closes #2159
closes #2137

@mmagician
Copy link
Collaborator Author

We should also add a safety check similar to #2173 to ensure that only the bridge account can consume this note. I added a comment to the mentioned issue so that tackling it could address both UPDATE_GER and B2AGG note script checks.

Copy link
Contributor

@partylikeits1983 partylikeits1983 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

For now we just store the 256 bit GER in 2 slots, but not in an array just yet? Assuming will update this once the double word array PR lands: #2299

@partylikeits1983 partylikeits1983 added the no changelog This PR does not require an entry in the `CHANGELOG.md` file label Jan 23, 2026
@mmagician
Copy link
Collaborator Author

For now we just store the 256 bit GER in 2 slots, but not in an array just yet?

Exactly - but since we didn't store the GER at all until now, this should allow some minimal degree of testing against a real GER

@mmagician mmagician marked this pull request as ready for review January 23, 2026 17:54
@mmagician mmagician merged commit cfdf123 into agglayer Jan 24, 2026
17 checks passed
@mmagician mmagician deleted the mmagician-update-ger branch January 24, 2026 10:18
mmagician added a commit that referenced this pull request Jan 24, 2026
* feat: UPDATE_GER note outline

* feat: working update ger note

* chore: swap upper, lower GER parts

* lint: regen error file
Comment on lines +16 to +17
#! This note can only be consumed by the specific agglayer bridge account whose ID is provided
#! in the note attachment (target_account_id).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not currently enforced, right? If so, might be good to add a comment about this.

Comment on lines +7 to +8
const GER_UPPER_STORAGE_SLOT=word("miden::agglayer::bridge::ger_upper")
const GER_LOWER_STORAGE_SLOT=word("miden::agglayer::bridge::ger_lower")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of comments on these:

  • Do we actually need to store the full GER? it seems like, the claim note inputs can be used to compute the GER and then, we just need to check if the GER computed from the note matches the GER in the bride. For this, we just need to store GER commitment (i.e., RPO hash). This would mean we need only one storage slot.
  • Maybe we should make the storage slot into a map: hash(ger) |-> 1/0. This way, given a GER, we can compute its hash to reduce it to a single word, and then do a lookup to check if the GER is known or not.
  • It feels a bit odd that GER update functionality is in the bridge_in module. It probably would make sense to have a separate bridge_operator module for things like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agglayer no changelog This PR does not require an entry in the `CHANGELOG.md` file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants